import net.yiny.scrummer.model.Iteration
import net.yiny.scrummer.ui.storyboard.Storyboard
import static org.hamcrest.MatcherAssert.assertThat
import static org.hamcrest.Matchers.is
import static org.hamcrest.Matchers.sameInstance
import static org.mockito.Mockito.mock

before_each 'set up the storyboard object', {
    storyboard = new Storyboard()
}

scenario 'setting the iteration on the storyboard', {
    Iteration iteration
    given 'an iteration object', {
        iteration = mock(Iteration.class)
    }
    when 'you set the iteration on the storyboard object', {
        storyboard.iteration = iteration
    }
    then 'the iteration stored in the storyboard should be what was set', {
        assertThat storyboard.iteration, is(sameInstance(iteration))
    }
}

scenario 'setting stories on the stoeyboard object', {
    List stories
    given 'a list of stories', {
        stories = mock(List.class)
    }
    when 'you set the stories on the storyboard object', {
        storyboard.stories = stories
    }
    then 'the stories stored in the storyboard should be what was set', {
        assertThat storyboard.stories, is(sameInstance(stories))
    }
}

scenario 'setting phaeses on the storyboard object', {
    List phases
    given 'a list of phases', {
        phases = mock(List.class)
    }
    when 'you set the phases on the storyboard object', {
        storyboard.phases = phases
    }
    then 'the phases stored in the storyboard should be what was set', {
        assertThat storyboard.phases, is(sameInstance(phases))
    }
}
